package com.wzb.mybatisplus.bitaction.electrumaction.one;

public class KeyPair {
    private String privateKeyHex;
    private String privateKeyWIF;
    private String publicKeyCompressed;
    private String publicKeyUncompressed;
    private String legacyAddress;
    private String segwitAddress;
    private String p2shSegwitAddress;

    // Getters and Setters
    public String getPrivateKeyHex() { return privateKeyHex; }
    public void setPrivateKeyHex(String privateKeyHex) { this.privateKeyHex = privateKeyHex; }

    public String getPrivateKeyWIF() { return privateKeyWIF; }
    public void setPrivateKeyWIF(String privateKeyWIF) { this.privateKeyWIF = privateKeyWIF; }

    public String getPublicKeyCompressed() { return publicKeyCompressed; }
    public void setPublicKeyCompressed(String publicKeyCompressed) { this.publicKeyCompressed = publicKeyCompressed; }

    public String getPublicKeyUncompressed() { return publicKeyUncompressed; }
    public void setPublicKeyUncompressed(String publicKeyUncompressed) { this.publicKeyUncompressed = publicKeyUncompressed; }

    public String getLegacyAddress() { return legacyAddress; }
    public void setLegacyAddress(String legacyAddress) { this.legacyAddress = legacyAddress; }

    public String getSegwitAddress() { return segwitAddress; }
    public void setSegwitAddress(String segwitAddress) { this.segwitAddress = segwitAddress; }

    public String getP2shSegwitAddress() { return p2shSegwitAddress; }
    public void setP2shSegwitAddress(String p2shSegwitAddress) { this.p2shSegwitAddress = p2shSegwitAddress; }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("=== 比特币密钥对 ===\n");
        sb.append("私钥 (HEX): ").append(privateKeyHex).append("\n");
        sb.append("私钥 (WIF): ").append(privateKeyWIF).append("\n");
        sb.append("公钥 (压缩): ").append(publicKeyCompressed).append("\n");
        sb.append("公钥 (未压缩): ").append(publicKeyUncompressed).append("\n");
        sb.append("Legacy地址 (P2PKH): ").append(legacyAddress).append("\n");
        sb.append("隔离见证地址 (Bech32): ").append(segwitAddress).append("\n");
        sb.append("P2SH隔离见证地址: ").append(p2shSegwitAddress).append("\n");
        return sb.toString();
    }
}